import request from '@/utils/request'
// 获取所有对象
export function getAllQuests() {
  return request({
    url: '/api/Quest/getAllQuests',
    method: 'get'
  })
}
// 根据ID获取对象
export function getQuestById(id) {
  return request({
    url: '/api/Quest/getQuestsById',
    method: 'post',
    params: { id: id }
  })
}
// 分页获取对象
export function getQuestsByPage(page, size) {
  return request({
    url: '/api/Quest/getQuestsByPage',
    method: 'post',
    params: { page: page, size: size }
  })
}
// 分页倒序获取对象
export function getQuestsByPageDesc(page, size) {
  return request({
    url: '/api/Quest/getQuestsByPageDesc',
    method: 'post',
    params: { page: page, size: size }
  })
}
// 新增&&更新对象
export function saveQuest(Quest) {
  return request({
    url: '/api/Quest/saveQuest',
    method: 'post',
    data: Quest,
    header: {
      'Content-Type': 'application/json'
    }
  })
}
// 批量新增&&更新对象
export function saveQuests(Quests) {
  return request({
    url: '/api/Quest/saveQuests',
    method: 'post',
    data: Quests,
    header: {
      'Content-Type': 'application/json'
    }
  })
}
// 根据Id删除对象
export function deleteQuestById(id) {
  return request({
    url: '/api/Quest/deleteQuestById',
    method: 'post',
    params: { id: id }
  })
}
// 删除对象
export function deleteQuest(Quest) {
  return request({
    url: '/api/Quest/deleteQuest',
    method: 'post',
    data: Quest,
    header: {
      'Content-Type': 'application/json'
    }
  })
}
